package vip.xiaonuo.supplier.modular.warehouse.storesstream.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import vip.xiaonuo.common.pojo.CommonEntity;
import vip.xiaonuo.supplier.modular.base.productions.entity.SupplierProductions;
import vip.xiaonuo.supplier.modular.base.stores.entity.SupplierStores;
import vip.xiaonuo.supplier.modular.business.businessMain.entity.SupplierBusinessMain;
import vip.xiaonuo.supplier.modular.custom.objects.entity.SupplierObjects;
import vip.xiaonuo.supplier.modular.purchase.suppliers.entity.SupplierSuppliers;
import vip.xiaonuo.supplier.modular.warehouse.storeslocation.entity.SupplierStoresLocation;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 库存流水实体
 *
 * @author Mr.wu
 * @date  2025/03/19 09:49
 **/
@Getter
@Setter
@TableName("SUPPLIER_STORES_STREAM")
public class SupplierStoresStream extends CommonEntity {

    /** 库存流水ID */
    @TableId
    @Schema(description = "库存流水ID")
    private String id;

    /** 商品ID */
    @Schema(description = "商品ID")
    @Trans(type = TransType.SIMPLE, target = SupplierProductions.class, fields = "productionName", alias = "productions", ref = "streamProductionIdName")
    private String streamProductionId;

     /**商品ID名称 */
    @Schema(description = "商品ID名称")
    @TableField(exist = false)
    private String streamProductionIdName;

    /** 商品编码 */
    @Schema(description = "商品编码")
    private String streamProductionCode;

    /** 商品条码 */
    @Schema(description = "商品条码")
    private String streamProductionBarcode;

    /** 商品名称 */
    @Schema(description = "商品名称")
    private String streamProductionName;

    /** 商品规格 */
    @Schema(description = "商品规格")
    private String streamProductionSpec;

    /** 商品单位 */
    @Schema(description = "商品单位")
    private String streamProductionUnit;

    /** 批次 */
    @Schema(description = "批次")
    private String streamProductionBatch;

    /** 生产日期 */
    @Schema(description = "生产日期")
    private Date streamDateManufacture;

    /** 门店ID */
    @Schema(description = "门店ID")
    @Trans(type = TransType.SIMPLE, target = SupplierStores.class, fields = "storeName", alias = "stores", ref = "streamStoreIdName")
    private String streamStoreId;

     /**门店ID名称 */
    @Schema(description = "门店ID名称")
    @TableField(exist = false)
    private String streamStoreIdName;

    /** 仓库ID */
    @Schema(description = "仓库ID")
    @Trans(type = TransType.SIMPLE, target = SupplierStores.class, fields = "storeName", alias = "stores", ref = "streamStorageIdName")
    private String streamStorageId;

    /**仓库ID名称 */
    @Schema(description = "仓库ID名称")
    @TableField(exist = false)
    private String streamStorageIdName;

    /** 库位 */
    @Schema(description = "库位")
    @Trans(type = TransType.SIMPLE, target = SupplierStoresLocation.class, fields = "locationName", alias = "stores", ref = "streamStoreLocationName")
    private String streamStoreLocation;

    /**库位名称 */
    @Schema(description = "库位名称")
    @TableField(exist = false)
    private String streamStoreLocationName;

    /** 入库数量 */
    @Schema(description = "入库数量")
    private BigDecimal streamInNumber;

    /** 出库数量 */
    @Schema(description = "出库数量")
    private BigDecimal streamOutNumber;

    /** 业务类型 */
    @Schema(description = "业务类型")
    @Trans(type = TransType.DICTIONARY, key = "SUPPLIER_BUSINESS_TYPE", ref = "streamBusinessTypeName")
    private String streamBusinessType;

    /**业务类型名称 */
    @Schema(description = "业务类型名称")
    @TableField(exist = false)
    private String streamBusinessTypeName;

    /** 业务单号 */
    @Schema(description = "业务单号")
    @Trans(type = TransType.SIMPLE, target = SupplierBusinessMain.class, fields = "businessCode", alias = "suppliers", ref = "streamBusinessIdName")
    private String streamBusinessId;

    /**主业务单号Code */
    @Schema(description = "主业务单号")
    @TableField(exist = false)
    private String streamBusinessIdName;

    /** 实时库存 */
    @Schema(description = "实时库存")
    private BigDecimal streamProductionStock;

    /** 业务对象 */
    @Schema(description = "业务对象")
    @Trans(type = TransType.SIMPLE, target = SupplierObjects.class, fields = "objectName", alias = "suppliers", ref = "streamObjectIdName")
    private String streamObjectId;

     /**业务对象名称 */
    @Schema(description = "业务对象名称")
    @TableField(exist = false)
    private String streamObjectIdName;

    /** 备注 */
    @Schema(description = "备注")
    private String remark;

    /** 扩展信息 */
    @Schema(description = "扩展信息")
    private String extJson;

    /** 数据归属 */
    @Schema(description = "数据归属")
    private String companyId;
}
